<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>小米跨境电商ERP系统</title>
    <link rel="stylesheet" type="text/css" href="__css__/style.css" tppabs="css/style.css"/>
    <meta name="description" content="小米跨境电商ERP系统">

    <style>
        body {
            height: 100%;
            background: #16a085;
            overflow: hidden;
        }

        canvas {
            z-index: -1;
            position: absolute;
        }
    </style>
    <script src="__js__/jquery.min.js"></script>
    <script src="__module__/layer/layer.js"></script>
    <script src="__js__/verificationNumbers.js" tppabs="js/verificationNumbers.js"></script>
    <script src="__js__/Particleground.js" tppabs="js/Particleground.js"></script>

</head>
<body>
<?php
	$username = session('username');
	if(!empty($username )){  ?>
<script type="text/javascript">
    window.location.href = "{:url('admin/index/index')}";
</script>
<?php  } ?>
<dl class="admin_login">
    <dt style="color:white">
        <h1>小米跨境电商ERP系统</h1>
        <h2> 开发者: <a style="color: white;text-decoration:underline;" target="_blank" href="http://www.yimisoft.com/">一米软件</a>
        </h2>
    </dt>
    <dd class="user_icon">
        <input type="text" name="username" id='username' value="" placeholder="账号" class="login_txtbx"/>
    </dd>
    <dd class="pwd_icon">
        <input type="password" name="password" id="password" value="" placeholder="密码" class="login_txtbx"/>
    </dd>
    <dd>
        <button id="bs" onclick="login()" type="button" value="立即登陆" class="submit_btn"/>立即登陆</button>
    </dd>
    <dd>
        <p>Copyright © 2018.Yimisoft.com name All rights reserved.</p>
    </dd>
</dl>
</body>
<script>
    $(document).ready(function () {
        //粒子背景特效
        $('body').particleground({
            dotColor: '#5cbdaa',
            lineColor: '#5cbdaa'
        });
    });


    function login() {
        var username = $('#username').val();
        var password = $('#password').val();
        $.ajax({
            url: 'login',
            type: 'post',
            dataType: 'json',
            data: {
                username: username,
                password: password
            },
        }).done(function (data) {
            // console.log(data);
            if (data.code == 0) {
                layer.msg(data.msg);
            } else {
                layer.msg(data.msg, {icon: 1}, function () {
                    location.href = "index/index";
                });

            }
        })
    }

    document.onkeydown = function (e) {
        var ev = document.all ? window.event : e;
        if (ev.keyCode == 13) {
            login();
        }
    }
</script>
</html>
